package com.zt.controller;

import com.zt.service.LoanApplicationService;
import com.zt.system.LoanApplication;
import com.zt.system.vo.LoanVO;
import com.zt.utils.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("loanApplication")
public class LoanApplicationController {
    @Resource
    private LoanApplicationService loanApplicationService;
//    申请贷款记录
    @GetMapping("loanApplicationSave")
    private Result loanApplicationSave( LoanVO loanVO){
        System.out.println("LoanVO"+loanVO);
        return loanApplicationService.loanApplicationSave(loanVO);
    }
//    查询所有的申请记录
    @GetMapping("loanApplicationFind")
    private List<LoanApplication> loanApplicationFind(){
        return loanApplicationService.loanApplicationFind();
    }
//    批准-根据id进行查询
    @GetMapping("loanApplicationByApplicationId")
    public Result loanApplicationByApplicationId(Integer applicationId){
        return loanApplicationService.loanApplicationByApplicationId(applicationId);
    }
    //    拒绝-根据id进行查询
    @GetMapping("loanApplicationByApplicationIdJuJue")
    public Result loanApplicationByApplicationIdJuJue(Integer applicationId){
        return loanApplicationService.loanApplicationByApplicationIdJuJue(applicationId);
    }
}
